<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>将数字转化成百分⽐格式</title>
</head>
<body>
     <script>
        var name = prompt('请输入数值，会自动帮你转换成百分比格式');
        name = Number(name);// 转换成数值型，否则默认是字符型
        var sak = name * 100 + '%';
        alert(sak);
     </script>
</body>
</html>